package cn.tedu.sample.mapper;

import cn.tedu.sample.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    @Insert("INSERT INTO t_user (username,password,age,phone,email)"
            + "values(#{username},#{password},#{age},#{phone},#{email})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
     Integer addnew(User user);
    Integer updateUserInfo(User user);
    @Select("SELECT id,username,age,password,email,phone FROM t_user WHERE username=#{username}")
    User findUserByUsername(String username);
}
